<%@ page contentType="text/html; charset=utf-8"%>
<%@ include file="/global/jsp-header.jsp"%>
<!DOCTYPE HTML>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html">
		<title>角色菜单权限设置</title>
		<%@ include file="/global/ligerui-header.jsp"%>
		<script id="scriptInit" type="text/javascript">
		    var manager = null;
	        $(function () {
	            $("#rabcTree").ligerTree({ checkbox: false, childIcon: null });
	            manager = $("#rabcTree").ligerGetTreeManager();
	            
	            var msg='${operatorMsg}';
	        	if(msg){
	        		$.ligerDialog.alert(msg, '角色菜单设置', "none");
	        	}
	        }); 
	        function collapseAll(){
	            manager.collapseAll();
	        }
	        function expandAll(){
	            manager.expandAll();
	        }
		</script>
	</head>
	<body>
	<div class="container ">
	  <div class="content">
		 <a class="button blue" onclick="collapseAll()" style="float:left;margin-right:10px;">折叠全部</a> 
	     <a class="button blue" onclick="expandAll()" style="float:left;margin-right:10px;">张开全部</a> 
	     <div class="l-clear"></div>
	     <br />
	     <form action="/rbac/role-menu.do" name="myform" class="myform"
					id="myform" method="post">
			<input type="hidden" name="roleId" value="${roleId }"/>
        <c:if test="${not empty roleMenuFolders }">
	    <div style="width:80%; height:100%;overflow:hidden; clear:both;">
		   <ul id="rabcTree">
	            <c:forEach items="${roleMenuFolders}" var="item">
			        <li id="menu_${item.menu.menuId }">
			            <span>${item.menu.menuName }</span>
			            <ul>
					    	<c:if test="${not empty item.childs }">
					    		<c:forEach items="${item.childs }" var ="childMenu">
				                	<li>
						          		<span>
							          	<input type="checkbox" name="isDisplay_${childMenu.menuId}" value="0" ${childMenu.display eq 1 ? 'checked="checked"' : ''}/>
						          		${childMenu.menuName }
						          		</span>
				                	</li>
				                </c:forEach>
					        </c:if>
			            </ul>
			        </li>
		        </c:forEach>
		   </ul>
		    <div align="center" style="margin-top: 10px; margin-bottom: 10px;">
			    <input type="submit" class="button blue" value="确定" style="float:left;margin-right: 10px;"/>
			    <input type="button" class="button blue" value="返回" style="float:left" onclick="location.href='/role/role-input.do'"/>
			</div>
		   </div>
         </c:if>
	    <span style="clear:both;color:blue;">温馨提示：在选中/取消可见后，需要点击确定按钮，权限分配才能成功。</span>
	    </form>
	  </div>
	</div>
	</body>
</html>